using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._LinearReferencingTools
{
    /// <summary>
    /// <para>Locate Features Along Routes</para>
    /// <para>Computes the intersection of input features (point, line, or polygon) and route features and writes the route and measure information to a new event table.</para>
    /// <para>计算输入要素（点、线或面）和路径要素的交点，并将路径和测量信息写入新的事件表。</para>
    /// </summary>    
    [DisplayName("Locate Features Along Routes")]
    public class LocateFeaturesAlongRoutes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public LocateFeaturesAlongRoutes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features.</para>
        /// <para>输入点、线或面要素。</para>
        /// </param>
        /// <param name="_in_routes">
        /// <para>Input Route Features</para>
        /// <para>The routes with which the input features will be intersected.</para>
        /// <para>输入要素将与之相交的路径。</para>
        /// </param>
        /// <param name="_route_id_field">
        /// <para>Route Identifier Field</para>
        /// <para>The field containing values that uniquely identify each route. This field can be numeric or character.</para>
        /// <para>包含唯一标识每个路由的值的字段。此字段可以是数字或字符。</para>
        /// </param>
        /// <param name="_radius_or_tolerance">
        /// <para>Search Radius</para>
        /// <para><xdoc>
        ///   <para>If the input features are points, the search radius is a numeric value defining how far around each point a search will be done to find a target route.</para>
        ///   <para>If the input features are lines, the search tolerance is really a cluster tolerance, which is a numeric value representing the maximum tolerated distance between the input lines and the target routes.</para>
        ///   <para>If the input features are polygons, this parameter is ignored and no search radius is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果输入要素是点，则搜索半径是一个数值，用于定义在每个点周围进行搜索以查找目标路径的距离。</para>
        ///   <para>如果输入要素是线，则搜索容差实际上是聚类容差，它是一个数值，表示输入线与目标路径之间的最大容差距离。</para>
        ///   <para>如果输入要素为面，则忽略此参数，并且不使用搜索半径。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output Event Table</para>
        /// <para>The table to be created.</para>
        /// <para>要创建的表。</para>
        /// </param>
        /// <param name="_out_event_properties">
        /// <para>Output Event Table Properties</para>
        /// <para><xdoc>
        ///   <para>Parameter consisting of the route location fields and the type of events that will be written to the output event table.</para>
        ///   <bulletList>
        ///     <bullet_item>Route Identifier Field—The field that will contain values that indicate the route on which each event is located.</bullet_item><para/>
        ///     <bullet_item>Event Type—The type of events the output event table will contain (POINT or LINE).
        ///     <bulletList>
        ///       <bullet_item>POINT—Point events occur at a precise location along a route. Only a single measure field must be specified.  </bullet_item><para/>
        ///       <bullet_item>LINE—Line events define a portion of a route. Both from- and to-measure fields must be specified.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>From-Measure Field—A field that will contain measure values. Required when the event type is POINT or LINE. Note when the Event Type is POINT, the label for this parameter becomes Measure Field.</bullet_item><para/>
        ///     <bullet_item>To-Measure Field—A field that will contain measure values. Required when the event type is LINE.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>由路径位置字段和将写入输出事件表的事件类型组成的参数。</para>
        ///   <bulletList>
        ///     <bullet_item>路径标识符字段 - 包含指示每个事件所在路径的值的字段。</bullet_item><para/>
        /// <bullet_item>事件类型 - 输出事件表将包含的事件类型（POINT 或 LINE）。
        ///     <bulletList>
        ///       <bullet_item>POINT - 点事件发生在沿路径的精确位置。只需指定一个度量字段。 </bullet_item><para/>
        ///       <bullet_item>LINE - 线事件定义路径的一部分。必须同时指定 from-measure 和 to-measure 字段。 </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>From-Measure 字段 - 包含测量值的字段。当事件类型为 POINT 或 LINE 时为必填项。注意：当“事件类型”为“点”时，此参数的标签将变为“测量字段”。</bullet_item><para/>
        ///     <bullet_item>待测量字段 （To-Measure Field） - 将包含测量值的字段。当事件类型为LINE时为必填项。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public LocateFeaturesAlongRoutes(object _in_features, object _in_routes, object _route_id_field, string _radius_or_tolerance, object _out_table, object _out_event_properties)
        {
            this._in_features = _in_features;
            this._in_routes = _in_routes;
            this._route_id_field = _route_id_field;
            this._radius_or_tolerance = _radius_or_tolerance;
            this._out_table = _out_table;
            this._out_event_properties = _out_event_properties;
        }
        public override string ToolboxName => "Linear Referencing Tools";

        public override string ToolName => "Locate Features Along Routes";

        public override string CallName => "lr.LocateFeaturesAlongRoutes";

        public override List<string> AcceptEnvironments => ["configKeyword", "extent", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _in_routes, _route_id_field, _radius_or_tolerance, _out_table, _out_event_properties, _route_locations.GetGPValue(), _distance_field.GetGPValue(), _zero_length_events.GetGPValue(), _in_fields.GetGPValue(), _m_direction_offsetting.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input point, line, or polygon features.</para>
        /// <para>输入点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Input Route Features</para>
        /// <para>The routes with which the input features will be intersected.</para>
        /// <para>输入要素将与之相交的路径。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Route Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_routes { get; set; }


        /// <summary>
        /// <para>Route Identifier Field</para>
        /// <para>The field containing values that uniquely identify each route. This field can be numeric or character.</para>
        /// <para>包含唯一标识每个路由的值的字段。此字段可以是数字或字符。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Route Identifier Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _route_id_field { get; set; }


        /// <summary>
        /// <para>Search Radius</para>
        /// <para><xdoc>
        ///   <para>If the input features are points, the search radius is a numeric value defining how far around each point a search will be done to find a target route.</para>
        ///   <para>If the input features are lines, the search tolerance is really a cluster tolerance, which is a numeric value representing the maximum tolerated distance between the input lines and the target routes.</para>
        ///   <para>If the input features are polygons, this parameter is ignored and no search radius is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果输入要素是点，则搜索半径是一个数值，用于定义在每个点周围进行搜索以查找目标路径的距离。</para>
        ///   <para>如果输入要素是线，则搜索容差实际上是聚类容差，它是一个数值，表示输入线与目标路径之间的最大容差距离。</para>
        ///   <para>如果输入要素为面，则忽略此参数，并且不使用搜索半径。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Radius")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string _radius_or_tolerance { get; set; }


        /// <summary>
        /// <para>Output Event Table</para>
        /// <para>The table to be created.</para>
        /// <para>要创建的表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Event Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Output Event Table Properties</para>
        /// <para><xdoc>
        ///   <para>Parameter consisting of the route location fields and the type of events that will be written to the output event table.</para>
        ///   <bulletList>
        ///     <bullet_item>Route Identifier Field—The field that will contain values that indicate the route on which each event is located.</bullet_item><para/>
        ///     <bullet_item>Event Type—The type of events the output event table will contain (POINT or LINE).
        ///     <bulletList>
        ///       <bullet_item>POINT—Point events occur at a precise location along a route. Only a single measure field must be specified.  </bullet_item><para/>
        ///       <bullet_item>LINE—Line events define a portion of a route. Both from- and to-measure fields must be specified.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>From-Measure Field—A field that will contain measure values. Required when the event type is POINT or LINE. Note when the Event Type is POINT, the label for this parameter becomes Measure Field.</bullet_item><para/>
        ///     <bullet_item>To-Measure Field—A field that will contain measure values. Required when the event type is LINE.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>由路径位置字段和将写入输出事件表的事件类型组成的参数。</para>
        ///   <bulletList>
        ///     <bullet_item>路径标识符字段 - 包含指示每个事件所在路径的值的字段。</bullet_item><para/>
        /// <bullet_item>事件类型 - 输出事件表将包含的事件类型（POINT 或 LINE）。
        ///     <bulletList>
        ///       <bullet_item>POINT - 点事件发生在沿路径的精确位置。只需指定一个度量字段。 </bullet_item><para/>
        ///       <bullet_item>LINE - 线事件定义路径的一部分。必须同时指定 from-measure 和 to-measure 字段。 </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>From-Measure 字段 - 包含测量值的字段。当事件类型为 POINT 或 LINE 时为必填项。注意：当“事件类型”为“点”时，此参数的标签将变为“测量字段”。</bullet_item><para/>
        ///     <bullet_item>待测量字段 （To-Measure Field） - 将包含测量值的字段。当事件类型为LINE时为必填项。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Event Table Properties")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_event_properties { get; set; }


        /// <summary>
        /// <para>Keep only the closest route location</para>
        /// <para><xdoc>
        ///   <para>When locating points along routes, it is possible that more than one route may be within the search radius of any given point. This parameter is ignored when locating lines or polygons along routes.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Only the closest route location will be written to the output event table. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Every route location (within the search radius) will be written to the output event table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>沿路径定位点时，任何给定点的搜索半径内可能有多个路径。沿路径定位线或面时，将忽略此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 仅将最近的路径位置写入输出事件表。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 每个路径位置（搜索半径内）都将写入输出事件表。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep only the closest route location")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _route_locations_value _route_locations { get; set; } = _route_locations_value._true;

        public enum _route_locations_value
        {
            /// <summary>
            /// <para>FIRST</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FIRST")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ALL")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include distance field on output table</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a field named DISTANCE will be added to the output event table. The values in this field are in the units of the specified search radius. This parameter is ignored when locating lines or polygons along routes.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—A field containing the point-to-route distance will be added to the output event table. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—A field containing the point-to-route distance will not be added to the output event table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将名为 DISTANCE 的字段添加到输出事件表中。此字段中的值以指定搜索半径为单位。沿路径定位线或面时，将忽略此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 包含点到路径距离的字段将添加到输出事件表中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 包含点到路径距离的字段不会添加到输出事件表中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include distance field on output table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distance_field_value _distance_field { get; set; } = _distance_field_value._true;

        public enum _distance_field_value
        {
            /// <summary>
            /// <para>DISTANCE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DISTANCE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_DISTANCE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_DISTANCE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Keep zero length line events</para>
        /// <para><xdoc>
        ///   <para>When locating polygons along routes, it is possible that events can be created where the from-measure is equal to the to-measure. This parameter is ignored when locating points or lines along routes.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Zero-length line events will be written to the output event table. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Zero-length line events will not be written to the output event table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>沿路径定位面时，可以在 from-measure 等于待测量值的情况下创建事件。沿路径定位点或线时，将忽略此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 零长度线事件将写入输出事件表。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会将零长度线事件写入输出事件表。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep zero length line events")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _zero_length_events_value _zero_length_events { get; set; } = _zero_length_events_value._true;

        public enum _zero_length_events_value
        {
            /// <summary>
            /// <para>ZERO</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ZERO")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ZERO</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ZERO")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Include all fields from input</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output event table will contain route location fields plus all the attributes from the input features.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The output event table will contain route location fields plus all the attributes from the input features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The output event table will only contain route location fields plus the ObjectID field from the input features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出事件表是否包含路径位置字段以及输入要素中的所有属性。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 输出事件表将包含路径位置字段以及输入要素中的所有属性。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 输出事件表将仅包含路径位置字段以及输入要素中的 ObjectID 字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Include all fields from input")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _in_fields_value _in_fields { get; set; } = _in_fields_value._true;

        public enum _in_fields_value
        {
            /// <summary>
            /// <para>FIELDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FIELDS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_FIELDS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_FIELDS")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Use M direction offsetting</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the offset distance calculated should be based on the M direction or the digitized direction. Distances are included in the output event table if Include distance field on output table is checked.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The distance values in the output event table will be calculated based on the routes' M direction. Input features to the left of the M direction of the route will be assigned a positive offset (+), and features to the right of the M direction will be assigned a negative offset value (-). This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The distance values in the output event table will be calculated based on the routes' digitized direction. Input features to the left of the digitized direction of the route will be assigned a negative (-) offset, and features to the right of the digitized direction will be assigned a positive offset value (+).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定计算的偏移距离应基于 M 方向还是数字化方向。如果选中了输出表上的包括距离字段，则距离将包含在输出事件表中。</para>
        ///   <bulletList>
        ///     <bullet_item>选中—输出事件表中的距离值将根据路径的 M 方向进行计算。路径 M 方向左侧的输入要素将被分配一个正偏移 （+），而 M 方向右侧的要素将被分配一个负偏移值 （-）。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中—输出事件表中的距离值将根据路径的数字化方向进行计算。路径数字化方向左侧的输入要素将被分配负偏移 （-），数字化方向右侧的要素将被分配正偏移值 （+）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Use M direction offsetting")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _m_direction_offsetting_value _m_direction_offsetting { get; set; } = _m_direction_offsetting_value._true;

        public enum _m_direction_offsetting_value
        {
            /// <summary>
            /// <para>M_DIRECTON</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("M_DIRECTON")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_M_DIRECTION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_M_DIRECTION")]
            [GPEnumValue("false")]
            _false,

        }

        public LocateFeaturesAlongRoutes SetEnv(object configKeyword = null, object extent = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(configKeyword: configKeyword, extent: extent, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}